<template>
	<view>
		<view class="initial-Share-view">
			<view class="padding-30 margin-top13">
				<!-- 轮播图 -->
				<u-swiper :list="list" :height="400" bg-color="#C62F23" border-radius="20"></u-swiper>
			</view>
		</view>
		<!-- 中国梦创原始股 -->
		<view v-for="(item,index) in InitialList" :key="index">
			<view class="padding-30">
				<line-title :name="item.name"></line-title>
			</view>
			<view class="InitialItem padding-30">
				<image class="initialShare-image" :src="item.img" mode=""></image>
			    <view  @click="goToUrl('/pages/initialShare/initialShare-info?id='+item.id+'&name='+item.name,item.switch)" class="ad-view-btn">{{item.switch==1?'激活':'暂未开放'}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import lineTitle from "@/components/title/line-title.vue"
	export default {
		components: {
			lineTitle,
		},
		data() {
			return {
				list: ['../../static/index/23.jpg', '../../static/index/23.jpg'],
				InitialList:[]
			}
		},
		onShow() {
			this.getInitial()
		},
		methods: {
			getInitial(){
				this.$http.post(this.$api.getInitial,{},{token:true}).then(res=>{
					if(res.code == 1){
						this.InitialList = res.data
					}
				})
			},
			goToUrl(url,type){
				if(type == 1){
					this.$tools.navigateTo(url)
				}
			}
		}
	}
</script>

<style lang="scss">
	.InitialItem{
		position: relative;
	}
	.ad-view-btn {
		position: absolute;
		bottom: 60rpx;
		right: 50rpx;
		font-size: 15px;
		color: #BE1A0A;
		background-color: #ffffff;
		border-radius: 10rpx;
		padding: 10rpx 30rpx;
	}
	.initial-Share-view {
		width: 100%;
		height: 550rpx;
		background: url('../../static/index/18.png')no-repeat;
		background-size: 100% 100%;
		overflow: hidden;
	}

	.margin-top13 {
		margin-top: 80rpx;
	}
	
	.initialShare-image{
		width: 100%;
		height: 350rpx;
		border-radius: 30rpx;
	}
</style>